<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script>
			
			// 1.
			var str1 = new String("abc123")
			var str2 = "abc123";
			
			// 2.
			console.log(str1.length)
			
			// 3. 字符串的查找
			var ste3 = "skyrdkyt man irkdurjkgyfdmajguyf man 66 woman 1145sgdbg"
			// 得到指定位置的字符
			console.log(str3.charAt(2));
			console.log(str3.indexOf("man")) // 9
			console.log(str3.indexOf("man",15)) // 从位置15往后找
			console.log(str3.lastIndexOF("man")) // 从后往前找
			
			// 4. 字符串的截取
			var str4 = "abcdefghijk";
			// slice(开始的索引,终止的索引)
			console.log(str4.slice(3,7)); // defg
			// substr(开始的索引,截取的长度)
			console.log(str4.substr(3,4));// defg
			// sbustring(开始的索引,终止的索引)
			console.log(str4.substring(3,7));// defg
			
		</script>
	</body>
</html>